home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / ZoomBlur.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1997-01-12  |  2.0 KB  |  85 lines

  1. /*******************************/
  2. /* ZoomBlur V2.0               */
  3. /* Image Engineer Macro script */
  4. /* by Simon Edwards            */
  5. /*                             */
  6. /* This creates a sort of zoom */
  7. /* motion blur effect.         */
  8. /*******************************/
  9.  
  10. Options results
  11. signal on error         /* Setup a place for errors to go */
  12.  
  13. if arg()==0 then exit
  14.  
  15. PROJECT_INFO arg(1) WIDTH
  16. sourcewidth=RESULT
  17. PROJECT_INFO arg(1) HEIGHT
  18. sourceheight=RESULT
  19.  
  20. form='FORM "Zoom Blur" "Ok|Cancel"'
  21. form=form||' CYCLE,"Size of Blur (pixels):","1|2|4|8|16|32|64",0'
  22. form=form||' CYCLE,"Method:","Blur|Max|Min",0'
  23. form
  24.  
  25. reply=RESULT
  26.  
  27. if word(reply,1)=0 then exit
  28.  
  29. times=word(reply,2)
  30. stepsize=2
  31.  
  32. select
  33.     when word(reply,3)=0 then method="MIX 50"
  34.     when word(reply,3)=1 then method="MAX"
  35.     when word(reply,3)=2 then method="MIN"
  36. end
  37.  
  38. SCALE arg(1) sourcewidth+stepsize sourceheight+stepsize BEST
  39. temp=RESULT
  40.  
  41. MARK temp PRIMARY
  42. MARK arg(1) SECONDARY
  43. COMPOSITE (sourcewidth-sourcewidth-stepsize)/2 (sourceheight-sourceheight-stepsize)/2 method
  44. temp2=RESULT
  45. CLOSE temp
  46.  
  47. stepsize=stepsize*2
  48.  
  49. do while times~=0
  50.  
  51.     SCALE temp2 sourcewidth+stepsize sourceheight+stepsize BEST
  52.     temp=RESULT
  53.     
  54.     MARK temp PRIMARY
  55.     MARK temp2 SECONDARY
  56.     COMPOSITE (sourcewidth-sourcewidth-stepsize)/2 (sourceheight-sourceheight-stepsize)/2 method
  57.     temp3=RESULT
  58.     CLOSE temp2
  59.     CLOSE temp
  60.  
  61.     temp2=temp3
  62.     stepsize=stepsize*2
  63.     times=times-1
  64. end
  65.  
  66. exit
  67.  
  68. /*******************************************************************/
  69. /* This is where control goes when an error code is returned by IE */
  70. /* It puts up a message saying what happened and on which line     */
  71. /*******************************************************************/
  72. error:
  73. if RC=5 then do         /* Did the user just cancel us? */
  74.     IE_TO_FRONT
  75.     LAST_ERROR
  76.     'REQUEST "'||RESULT||'"'
  77.     exit
  78. end
  79. else do
  80.     IE_TO_FRONT
  81.     LAST_ERROR
  82.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  83.     exit
  84. end
  85.